summaryrefslogtreecommitdiff
path: root/app/[lng]/procurement/(procurement)/faq/page.tsx
blob: 0095659190e21e75d524e109aea539c350ab15ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { Separator } from "@/components/ui/separator"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { faqCategories } from "@/config/faqDataConfig"
import { FaqCard } from "@/components/faq/FaqCard"
import { Button } from "@/components/ui/button"
import { Settings } from "lucide-react"
import Link from "next/link"
import { fallbackLng } from "@/i18n/settings"

interface Props {
    params: {
        lng: string;
    }
}

export default async function FaqPage(props: Props) {
    const resolvedParams = await props.params
    const lng = resolvedParams.lng
    const localizedFaqCategories = faqCategories[lng] || faqCategories[fallbackLng];

    return (
        <div className="container py-6">
            <section className="overflow-hidden rounded-[0.5rem] border bg-background shadow">
                <div className="space-y-6 p-10 pb-16">
                    <div className="flex justify-between items-center">
                        <div className="space-y-0.5">
                            <h2 className="text-2xl font-bold tracking-tight">FAQ</h2>
                            {/* <p className="text-muted-foreground">
                                Find answers to common questions about using the EVCP system.
                            </p> */}
                        </div>
                        <Link href={`/${lng}/evcp/faq/manage`}>
                            <Button variant="outline">
                                <Settings className="w-4 h-4 mr-2" />
                                FAQ 관리
                            </Button>
                        </Link>
                    </div>
                    <Separator className="my-6" />
                    
                    <Tabs defaultValue={localizedFaqCategories[0]?.label} className="space-y-4">
                        <TabsList>
                            {localizedFaqCategories.map((category) => (
                                <TabsTrigger key={category.label} value={category.label}>
                                    {category.label}
                                </TabsTrigger>
                            ))}
                        </TabsList>

                        {localizedFaqCategories.map((category) => (
                            <TabsContent key={category.label} value={category.label} className="space-y-4">
                                {category.items.map((item, index) => (
                                    <FaqCard key={index} item={item} />
                                ))}
                            </TabsContent>
                        ))}
                    </Tabs>
                </div>
            </section>
        </div>
    )
}